package com.heima.media.listener;

import com.alibaba.fastjson.JSON;
import com.heima.media.entity.WmNews;
import com.heima.media.service.IAuditService;
import com.heima.media.tasks.MediaTasks;
import org.redisson.api.RBlockingQueue;
import org.redisson.api.RDelayedQueue;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.concurrent.TimeUnit;

@Service
public class PublishListener {

    @Autowired
    MediaTasks mediaTasks;

    @PostConstruct
    public void handMessage() {

        System.out.println("发布文章开始执行了。。。。。。。");

        try {
            mediaTasks.listen();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
